<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class KeywordRule extends Model
{
    const REPLY_ALL = 'reply_all';
    const RANDOM_ONE = 'random_one';

    public static $modeMap = [
        self::REPLY_ALL => '回复全部',
        self::RANDOM_ONE => '随机回复一条',
    ];

    protected $fillable = [
        'rule_name', 'keyword', 'reply_mode',
        'reply_type', 'reply_content', 'status',
    ];
    public function replies()
    {
        return $this->hasMany(KeywordReply::class, 'rule_id');
    }
}
